<script setup lang="ts">
import {ref} from "vue";
import {couponInfo} from "../../api/coupon.ts";
import CouponItem from "../../components/CouponItem.vue";

const couponList = ref<any[]>([])
couponInfo().then(res =>{
  couponList.value = res.data.result
})
</script>

<template>
  <div class="coupon-list">
    <CouponItem v-for="coupon in couponList" :key="coupon.id" :couponId="coupon.id" class="coupon-item"></CouponItem>
  </div>
</template>

<style scoped>
.coupon-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.coupon-item {
  width: calc(50% - 10px);
  margin-bottom: 20px;
}
</style>